package com.steve.rocketmq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: STEVE
 * @Description: 延迟队列测试控制器
 * @since: 2025-07-17
 */
@RestController
public class DelayController {

    @Autowired
    private DelayMessageProducer delayMessageProducer;

    @GetMapping("/sendDelay")
    public String sendDelayMessage(@RequestParam String message, @RequestParam int delayLevel) {
        delayMessageProducer.sendDelayMessage("D", message, delayLevel);
        return "延迟消息发送成功";
    }

}
